package LeetCode.Dfs;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author : LdLtd
 * @Date : 2023/12/24
 * @Description:
 */
public class Weight {
    // 123--1,2,3,4,5,6
   static Set<Integer> set=new HashSet<>();
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int [] ar=new int[n];
        for (int i = 0; i < n; i++) {
            ar[i]=sc.nextInt();
        }
        int [] flag=new int[3];
        for (int i = 0; i < n; i++) {
            dfs(ar,flag,0);
        }
        System.out.println(set.size());

    }
    public static void dfs(int [] ar,int []flag,int i){
        if(i==ar.length){
            int res=0;
            for (int i1 = 0; i1 < ar.length; i1++) {
                res+=ar[i1]*flag[i1];
            }
            if(res>0){
                set.add(res);
            }
            return;
        }
        for (int j = -1  ; j <2 ; j++) {
            flag[i]=j;
            dfs(ar,flag,i+1);
        }
    }
}
